﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using PersonalWebSite.Common;
using System.Text;
using System.Web.UI;

namespace PersonalWebSite.Controllers
{
    public class ClientReferencesController : BaseController
    {
        [OutputCache(Duration = 604800, Location = OutputCacheLocation.Client)]
        public FileResult Css(string cacheKey)
        {
            string content = Cache.CacheItem<ClientReferencesManager.UrlClientReferences>(cacheKey, null).CssMinifiedAndCombinedContent;
            return File(new UTF8Encoding().GetBytes(content), "text/css");
        }

        [OutputCache(Duration = 604800, Location = OutputCacheLocation.Client)]
        public FileResult Js(string cacheKey)
        {
            string content = Cache.CacheItem<ClientReferencesManager.UrlClientReferences>(cacheKey, null).JsMinifiedAndCombinedContent;
            return File(new UTF8Encoding().GetBytes(content), "text/javascript");
        }
    }
}
